package com.amar.dtadmin.apidoc.model;

import com.amar.dtadmin.apidoc.action.DtAdminApiDocActionGroup;
import com.amar.dtadmin.apidoc.extensions.storages.DtAdminSettings;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xiaoshiqiang
 * @since 2025/2/8
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class ApiDocUpdateReq extends ApiDocCreateReq {
    private String apiid;

    private ParamReq paramreq;

    private String updatedesc = "更新";
    private String updateuser;

    public ApiDocUpdateReq(DtAdminSettings settings, DtAdminApiDocActionGroup.ApiInfo apiInfo) {
        super(settings, apiInfo);
        this.updateuser = settings.getFullName();
        paramreq = new ParamReq(new ArrayList<>(), new ArrayList<>());
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ParamReq {
        private List<String> delreqs;
        private List<ParamItem> modifyreqs;
    }
}
